import { Spin } from 'antd';
// todo 有点不太好
const LoadingSceen = ({ show }: { show?: boolean }) => {
  const styles: React.CSSProperties = {
    position: 'fixed',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
    width: '100%',
    height: '100%',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    background: 'rgba(255, 255, 255, 0.75)',
    zIndex: 30,
  };
  if (!show) return null;
  return (
    <div style={styles}>
      <Spin size="large" />
    </div>
  );
};

export default LoadingSceen;
